前言
- 經過前幾篇瞭解一些基本的指令後,我們可以再為北風資料庫的查詢加入更多的變化
員工city跟country跟客戶資料表裡面有一樣的列表出來
MariaDB [northwind]>
MariaDB [northwind]> select employeeid, lastname,city , country
-> from employees
-> where row(city,country) in
-> (select city,country from customers);
+------------+-----------+----------+---------+
| employeeid | lastname | city | country |
+------------+-----------+----------+---------+
| 1 | Davolio | Seattle | USA |
| 3 | Leverling | Kirkland | USA |
| 5 | Buchanan | London | UK |
| 6 | Suyama | London | UK |
| 7 | King | London | UK |
| 8 | Callahan | Seattle | USA |
| 9 | Dodsworth | London | UK |
+------------+-----------+----------+---------+
7 rows in set (0.075 sec)